BIN=result
#SRC=$(shell ls *.cpp)
SRC=$(wildcard *cpp)    # wildcard函数，获取当前目录下的所有源文件
OBJ=$(SRC:.cpp=.o)    # 将所有的.cpp 文件换成.o 文件
CC=g++
CXXFLAGS = -std=c++11
Rm=rm -f
Echo=echo 


$(BIN):$(SRC)
		@$(CC) $(CXXFLAGS) $^ -o $@
		@$(Echo) "linking $^ to $@ ... done"

.PHONY:clean
clean:
		@$(Rm) $(OBJ) $(BIN)
		@$(Echo) "清理完毕"

.PHONY:test
test:
		@$(Echo) "Debug......"
		@$(Echo) $(SRC);
		@$(Echo) "Debug......"
		@$(Echo) $(OBJ);
		@$(Echo) "Debug......"


	
